package com.wxyzz.satserver.area.controller;

import com.wxyzz.common.core.annotation.NoLoginCheck;
import com.wxyzz.common.core.common.R;
import com.wxyzz.common.core.entity.Area;
import com.wxyzz.satserver.area.VO.AreaName;
import com.wxyzz.satserver.area.service.AreaServce;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * --- 加油，努力 ---
 *
 * @Author XYP
 * @Date 2024/11/10
 * @Solgne 从想做到能做
 * @Desc
 */
@RestController
@CrossOrigin
@RequestMapping("/area")
@Api(tags ="热门地区api")
public class AreaController {
    @Resource
    private AreaServce areaServce;

    @GetMapping("/getArea")
    @ApiOperation(value = "景点名称")
    public R getArea(){
        List<AreaName> areas = areaServce.selectAllName();
        return R.ok(areas);
    }

    @GetMapping("/getDetailById")
    @ApiOperation(value = "景点详情")
    public R getDetailById(Integer id){
        Area area = areaServce.selectById(id);
        return R.ok(area);
    }
}
